package Work1;

import java.io.*;
import java.net.Socket;

public class TestClient {
    public static void main(String[] args) {

        try {
            Socket socket = new Socket("192.168.3.140",6588);
            OutputStream os = socket.getOutputStream();
            PrintWriter pw = new PrintWriter(os);
            File file = new File("D:/故乡.txt");
            FileInputStream fis = new FileInputStream(file);
            InputStreamReader isr = new InputStreamReader(fis);

            BufferedReader br = new BufferedReader(isr);
           while (true){
               String s = br.readLine();
               if (s == null){
                   break;
               }
               System.out.println(s);
               pw.write(s);
               pw.write("\n");

           }
            System.out.println("客户端输入完毕!");
            pw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
